| Conditions | 5 |
| Paths | 16 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 5 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | const Pawn = require("./pieces/Pawn"); |
|
| 23 | constructor(color, name) { |
||
| 24 | 4 | this.color = color; |
|
| 25 | 4 | this.name = name; |
|
| 26 | 4 | this.takesPieces = []; |
|
| 27 | 4 | this.pawns = []; |
|
| 28 | 4 | this.rooks = []; |
|
| 29 | 4 | this.bishops = []; |
|
| 30 | 4 | this.knights = []; |
|
| 31 | 4 | this.queen = new Queen(color); |
|
| 32 | 4 | this.king = new King(color); |
|
| 33 | |||
| 34 | 4 | for (let i = 0; i < 8; i++) { |
|
| 35 | 32 | this.pawns.push(new Pawn(color)); |
|
| 36 | } |
||
| 37 | |||
| 38 | 4 | for (let i = 0; i < 2; i++) { |
|
| 39 | 8 | this.rooks.push(new Rook(color)); |
|
| 40 | } |
||
| 41 | |||
| 42 | 4 | for (let i = 0; i < 2; i++) { |
|
| 43 | 8 | this.bishops.push(new Bishop(color)); |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | for (let i = 0; i < 2; i++) { |
|
| 47 | 8 | this.knights.push(new Knight(color)); |
|
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 57 |